package dto.Repair;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;


/**
 * @author Kevin
 * @date 2020-12-29 20:09
 */
@Data
@NoArgsConstructor
public class RepairListResp {

    private int pageNum ;
    private int pageSize ;
    private int pageTotal ;
    private List<RespDate> data = new ArrayList<>();

    public void setRepairListResp(ResultSet rs) throws SQLException {
        while( rs.next() ){
            RespDate respDate = new RespDate(rs);
            this.data.add(respDate);
        }
    }

    public void setRespData(ResultSet rs, int pageNum, int pageTotal) throws SQLException {
        this.setRepairListResp(rs);
        this.pageNum = pageNum;
        this.pageTotal = pageTotal;
    }

}
